<template lang="html">
  <div class="main-page" id="store-page">
    <!-- 标题 -->
    <!-- <van-nav-bar class="main-header" title="商学院" :left-arrow="true" :fixed="true" :z-index="11" @click-left="onClickLeft"/> -->
    <nav-bar :title="'商学院'"  @goBack="onClickLeft"/>

    <!-- 主体内容 -->
    <div class="main-content business_details has-header-space">
      <div class="business_details_page">
        <div class="details_title">{{details.tiltle}}</div>
        <div class="details_info">
          <div class="detail_time">{{details.create_at}}</div>
          <div class="detail_read">
            <div class="read_user"></div>
            <span>{{details.read_nu}}人已学</span>
          </div>
        </div>

        <div class="detalis_content">
          <div class="audio_cc" v-if="details.audio_url">
            <audio controls>
              <source :src="details.audio_url" type="audio/ogg">
              <source src="horse.mp3" type="audio/mpeg">
            您的浏览器不支持 audio 元素。
            </audio>
            <!-- <audio poster="{{details.banner}}" controls="false" name="{{details.tiltle}}" author="{{details.auther}}" src="{{details.audio_url}}" id="myAudio" controls  class="audio_box"></audio> -->
          </div>
          <div class="article_content" v-html="details.content">
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import NavBar from '@/components/global/nav-bar.vue'
export default {
  components: { NavBar },
  data () {
    return {
      details: {}
    }
  },
  created () {
    this.getDetalis(this.$route.params.id)
  },
  methods: {
    onClickLeft () {
      this.$router.go(-1)
    },
    getDetalis (id) {
      return new Promise((resolve, reject) => {
        this.$Axios({ url: 'business_school/' + id, method: 'get' }).then((resp) => { // 请求成功
          if (resp.return_code === '0000') {
            this.details = resp.data
          }
          resolve(resp)
        }).catch((error) => { // 请求失败
          this.$_requestInterceptor('error', error)
          reject(error)
        })
      })
    }
  }
}
</script>
